In [1]:
%matplotlib inline
In [2]:
import math
import torch
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns

from startorch import sequence as seq
from startorch.utils.plot import hist_sequence, plot_sequence
In [3]:
plt.style.use("bmh")
plt.rcParams["figure.figsize"] = (16, 5)

Table of content¶

  • Continuous univariate supported on a bounded interval
    • Asinh-uniform
    • Log-uniform
    • Truncated Cauchy
    • Truncated Exponential
    • Truncated Normal
    • Truncated half-Cauchy
    • Truncated half-Normal
    • Truncated log-Normal
    • Uniform
  • Continuous univariate supported on a semi-inifinte interval
    • Exponential
    • Half-Cauchy
    • Half-Normal
    • Log-Normal
  • Continuous univariate supported on an inifinte interval
    • Cauchy
    • Normal
    • Wiener process
  • Discrete univariate supported on a semi-infinite support
    • Poisson
  • Discrete univariate supported on a finite support
    • Multinomial
    • Uniform categorical
    • Uniform integer

Continuous univariate supported on a bounded interval¶

top

Asinh-uniform¶

top

In [4]:
generator = seq.RandAsinhUniform(low=-1000.0, high=1000.0)
print(generator)
fig = plot_sequence(generator, batch_size=4)
RandAsinhUniformSequenceGenerator(low=-1000.0, high=1000.0, feature_size=(1,))
No description has been provided for this image
In [5]:
fig = hist_sequence(generator, bins=500)
fig = hist_sequence(generator, bins=500, scale='asinh')
No description has been provided for this image
No description has been provided for this image

Log-uniform¶

top

In [6]:
generator = seq.RandLogUniform(low=0.001, high=1000.0)
print(generator)
fig = plot_sequence(generator, batch_size=4)
RandLogUniformSequenceGenerator(low=0.001, high=1000.0, feature_size=(1,))
No description has been provided for this image
In [7]:
fig = hist_sequence(generator, bins=500)
fig = hist_sequence(generator, bins=500, scale='log10')
No description has been provided for this image
No description has been provided for this image

Truncated Cauchy¶

top

In [8]:
generator = seq.RandTruncCauchy(loc=0.0, scale=1.0)
print(generator)
fig = plot_sequence(generator, batch_size=4)
RandTruncCauchySequenceGenerator(loc=0.0, scale=1.0, min_value=-2.0, max_value=2.0, feature_size=(1,))
No description has been provided for this image
In [9]:
fig = hist_sequence(generator, bins=500)
No description has been provided for this image

Truncated Exponential¶

top

In [10]:
generator = seq.RandTruncExponential(rate=1.0, max_value=5.0)
print(generator)
fig = plot_sequence(generator, batch_size=4)
RandTruncExponentialSequenceGenerator(rate=1.0, max_value=5.0, feature_size=(1,))
No description has been provided for this image
In [11]:
fig = hist_sequence(generator, bins=500)
No description has been provided for this image

Truncated Normal¶

top

In [12]:
generator = seq.RandTruncNormal(mean=1.0, std=2.0, min_value=-2.0, max_value=4.0)
print(generator)
fig = plot_sequence(generator, batch_size=4)
RandTruncNormalSequenceGenerator(mean=1.0, std=2.0, min_value=-2.0, max_value=4.0, feature_size=(1,))
No description has been provided for this image
In [13]:
fig = hist_sequence(generator, bins=500)
No description has been provided for this image

Truncated half-Cauchy¶

top

In [14]:
generator = seq.RandTruncHalfCauchy(scale=1.0)
print(generator)
fig = plot_sequence(generator, batch_size=4)
RandTruncHalfCauchySequenceGenerator(scale=1.0, max_value=4.0, feature_size=(1,))
No description has been provided for this image
In [15]:
fig = hist_sequence(generator, bins=500)
No description has been provided for this image

Truncated half-Normal¶

top

In [16]:
generator = seq.RandTruncHalfNormal(std=1.0, max_value=2.0)
print(generator)
fig = plot_sequence(generator, batch_size=4)
RandTruncHalfNormalSequenceGenerator(std=1.0, max_value=2.0, feature_size=(1,))
No description has been provided for this image
In [17]:
fig = hist_sequence(generator, bins=500)
No description has been provided for this image

Truncated log-Normal¶

top

In [18]:
generator = seq.RandTruncLogNormal(mean=0.0, std=1.0, max_value=2.0)
print(generator)
fig = plot_sequence(generator, batch_size=4)
RandTruncLogNormalSequenceGenerator(mean=0.0, std=1.0, min_value=0.0, max_value=2.0, feature_size=(1,))
No description has been provided for this image
In [19]:
fig = hist_sequence(generator, bins=500)
No description has been provided for this image

Uniform¶

top

In [20]:
generator = seq.RandUniform(low=-5, high=5)
print(generator)
fig = plot_sequence(generator, batch_size=4)
RandUniformSequenceGenerator(low=-5.0, high=5.0, feature_size=(1,))
No description has been provided for this image
In [21]:
fig = hist_sequence(generator, bins=500)
No description has been provided for this image

Continuous univariate supported on a semi-inifinte interval¶

Exponential¶

top

In [22]:
generator = seq.RandExponential(rate=0.1)
print(generator)
fig = plot_sequence(generator, batch_size=4)
RandExponentialSequenceGenerator(rate=0.1, feature_size=(1,))
No description has been provided for this image
In [23]:
fig = hist_sequence(generator, bins=500, range=(0, 5))
No description has been provided for this image

Half-Cauchy¶

top

In [24]:
generator = seq.RandHalfCauchy(scale=1.0)
print(generator)
fig = plot_sequence(generator, batch_size=4)
RandHalfCauchySequenceGenerator(scale=1.0, feature_size=(1,))
No description has been provided for this image
In [25]:
fig = hist_sequence(generator, bins=500, range=(0, 8))
No description has been provided for this image

Half-Normal¶

top

In [26]:
generator = seq.RandHalfNormal(std=1.0)
print(generator)
fig = plot_sequence(generator, batch_size=4)
RandHalfNormalSequenceGenerator(std=1.0, feature_size=(1,))
No description has been provided for this image
In [27]:
fig = hist_sequence(generator, bins=500, range=(0, 3))
No description has been provided for this image

Log-Normal¶

top

In [28]:
generator = seq.RandLogNormal(mean=0.0, std=1.0)
print(generator)
fig = plot_sequence(generator, batch_size=4)
RandLogNormalSequenceGenerator(mean=0.0, std=1.0, feature_size=(1,))
No description has been provided for this image
In [29]:
fig = hist_sequence(generator, bins=500, range=(0, 10))
No description has been provided for this image

Continuous univariate supported on an inifinte interval¶

top

Cauchy¶

top

In [30]:
generator = seq.RandCauchy(loc=0.0, scale=1.0)
print(generator)
fig = plot_sequence(generator, batch_size=4)
RandCauchySequenceGenerator(loc=0.0, scale=1.0, feature_size=(1,))
No description has been provided for this image
In [31]:
fig = hist_sequence(generator, bins=500, range=(-10, 10))
No description has been provided for this image

Normal¶

top

In [32]:
generator = seq.RandNormal(mean=0.0, std=1.0)
print(generator)
fig = plot_sequence(generator, batch_size=4)
RandNormalSequenceGenerator(mean=0.0, std=1.0, feature_size=(1,))
No description has been provided for this image
In [33]:
fig = hist_sequence(generator, bins=500, range=(-4, 4))
No description has been provided for this image

Wiener process¶

top

In [34]:
generator = seq.RandWienerProcess()
print(generator)
fig = plot_sequence(generator, batch_size=10)
RandWienerProcessSequenceGenerator(time_step_size=1.0)
No description has been provided for this image
In [35]:
fig = hist_sequence(generator, bins=500, range=(-100.0, 100.0))
No description has been provided for this image

Discrete univariate supported on a semi-infinite support¶

top

Poisson¶

top

In [36]:
generator = seq.RandPoisson(rate=5.0)
print(generator)
fig = plot_sequence(generator, batch_size=4)
RandPoissonSequenceGenerator(rate=5.0, feature_size=(1,))
No description has been provided for this image
In [37]:
fig = hist_sequence(generator, bins=100, range=(0, 10))
No description has been provided for this image

Discrete univariate supported on a finite support¶

top

Multinomial¶

top

In [38]:
generator = seq.Multinomial.create_linear_weights(num_categories=50)
print(generator)
fig = plot_sequence(generator, batch_size=4)
MultinomialSequenceGenerator(num_categories=50, feature_size=(1,))
No description has been provided for this image
In [39]:
fig = hist_sequence(generator, bins=50)
No description has been provided for this image
In [40]:
generator = seq.Multinomial.create_exp_weights(num_categories=50)
print(generator)
fig = plot_sequence(generator, batch_size=4)
MultinomialSequenceGenerator(num_categories=50, feature_size=(1,))
No description has been provided for this image
In [41]:
fig = hist_sequence(generator, bins=50)
No description has been provided for this image
In [42]:
generator = seq.Multinomial.create_uniform_weights(num_categories=50)
print(generator)
fig = plot_sequence(generator, batch_size=4)
MultinomialSequenceGenerator(num_categories=50, feature_size=(1,))
No description has been provided for this image
In [43]:
fig = hist_sequence(generator, bins=50)
No description has been provided for this image

Uniform categorical¶

top

In [44]:
generator = seq.UniformCategorical(num_categories=50)
print(generator)
fig = plot_sequence(generator, batch_size=4)
UniformCategoricalSequenceGenerator(num_categories=50, feature_size=())
No description has been provided for this image
In [45]:
fig = hist_sequence(generator, bins=50)
No description has been provided for this image

Uniform integer¶

top

In [46]:
generator = seq.RandInt(low=5, high=50)
print(generator)
fig = plot_sequence(generator, batch_size=4)
RandIntSequenceGenerator(low=5, high=50, feature_size=())
No description has been provided for this image
In [47]:
fig = hist_sequence(generator, bins=45)
No description has been provided for this image
In [ ]: